
// -----------------------------------------------------------
// InitNavLinks()
// Sets link text, URL and icon for NavLinks Show based on framed state
// -----------------------------------------------------------

function InitNavLinks() 
{
if ("object" != typeof(lnkShowText) || "object" != typeof(lnkShowImg) || "object" != typeof(imgShow))
{
return false;
}

var bIsFramed = top != self && "TOC" == top.frames[0].name ;
if (bIsFramed) 
{
lnkShowText.innerText = "hide toc";
lnkShowText.href = self.location.href;
lnkShowImg.href = self.location.href;
imgShow.src = "/workshop/graphics/icons/nl-hide-0.gif";
}
else 
{
lnkShowText.innerText = "show toc";
var sFrameHref = "/workshop/c-frame.htm#" + self.location.pathname;
lnkShowText.href = sFrameHref;
lnkShowImg.href = sFrameHref;
imgShow.src = "/workshop/graphics/icons/nl-show-0.gif";
}
}

// -----------------------------------------------------------
// NavLinks_hover()
// DHTML script for NavLinks mouseover and mouseout.
// -----------------------------------------------------------

function NavLinks_hover(eContainer) 
{
var eSrc = window.event.srcElement;
var sEventType = window.event.type;
while (eSrc != eContainer) 
{
if ("clsLeftMenu" == eSrc.className) {
window.event.cancelBubble = true;
if ("IMG" == eSrc.tagName) 
{
var eImg = eSrc;
eLink = document.all[eSrc.id.replace("img","lnk") + "Text"];
}
else if ("A" == eSrc.tagName) 
{
var eImg = document.all[eSrc.id.substring(0, eSrc.id.length - 4).replace("lnk","img")];
var eLink = eSrc;
}
if ("mouseover" == sEventType)
{
if ("object" == typeof(eImg)) eImg.src = eImg.src.substring(0,eImg.src.length - 5) + "1.gif";
if ("object" == typeof(eLink)) eLink.style.color = "red";
}
else if ("mouseout" == sEventType) 
{
if ("object" == typeof(eImg)) eImg.src = eImg.src.substring(0,eImg.src.length - 5) + "0.gif";
if ("object" == typeof(eLink)) eLink.style.color = "";
}
}
eSrc = eSrc.parentElement;
}
}

if ("object" == typeof(tblNavLinks)) 
{
tblNavLinks.onmouseover = new Function("NavLinks_hover(this)");
tblNavLinks.onmouseout = new Function("NavLinks_hover(this)");
}

// -----------------------------------------------------------
// PreloadNavLinksImages()
// Preloads mouseover images.
// -----------------------------------------------------------

function PreloadNavLinksImages()
{
var sRootPath = new String("/workshop/graphics/icons/");
var aImages = new Array("show","hide","sync","index","search","prev","next","up");
for (var i=0;i<aImages.length;i++) 
{
var eImg = new Image();
eImg.src = sRootPath + "nl-" + aImages[i] + "-1.gif";
}
}
if (oBD.getsNavBar) PreloadNavLinksImages();
